til bash

April 17th 2025, 3:49:16 pm EDT #

if you need to inject a message into a wall of text printed to the screen, like when starting jekyll or astro or rails server, you can read lines and print it at the appropriate time.

#!/bin/bash

pnpm run dev | while read line
do
  echo "$line"
  if [[ "$line" == *"Local"* ]]; then
    echo "✅ Your site is live! 🎉"
  fi
done